import QtQuick
import QtQuick.Controls
import QtQuick.Layouts

ApplicationWindow {
    visible: true
    width: 800
    height: 600
    title: "Flickable & Flipable"

    SwipeView {
        id: swipeView
        anchors.fill: parent

        Item {
            Column {
                spacing: 20
                anchors.centerIn: parent

                Text {
                    text: "Flickable Demo"
                    font.pixelSize: 24
                    anchors.horizontalCenter: parent.horizontalCenter
                }

                FlickableDemo {
                    anchors.horizontalCenter: parent.horizontalCenter
                }
            }
        }

        Item {
            Column {
                spacing: 20
                anchors.centerIn: parent

                Text {
                    text: "Flipable Card"
                    font.pixelSize: 24
                    anchors.horizontalCenter: parent.horizontalCenter
                }

                FlipableCard {
                    anchors.horizontalCenter: parent.horizontalCenter
                }
            }
        }

        Item {
            Column {
                spacing: 20
                anchors.centerIn: parent

                FlipableDemo {
                    id: loginDialog
                    visible: false
                }

                Button {
                    width: 120
                    height: 40
                    text: "弹窗"

                    onClicked: loginDialog.visible = true
                }
            }
        }
    }

    PageIndicator {
        anchors.bottom: swipeView.bottom
        anchors.horizontalCenter: parent.horizontalCenter
        currentIndex: swipeView.currentIndex
        count: swipeView.count
    }
}
